# Contributor: Rejah Rehim <rejah@beaglesecurity.com>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-python-jwt
_pkgname=python_jwt
pkgver=4.1.0
pkgrel=2
pkgdesc="Module for generating and verifying JSON Web Tokens"
url="https://github.com/davedoesdev/python-jwt"
arch="noarch"
license="MIT"
depends="py3-jwcrypto"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pyvows py3-gevent py3-coverage py3-mock npm"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	npm install jose
	msg "Running pyvows tests (this will take a while)"
	.testenv/bin/python3 -m test.run.run_pyvows --progress test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fb6f39723c60659e09915ee36b2742974d73353e9026c1ac536d3256bd7bff55b596b68af51a882a7e8c52b9caf960c3888a417cc0361d0edd313f9167fabb55  python_jwt-4.1.0.tar.gz
"
